package com.qf.advice;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author zjw
 * @description
 * @date 2021/9/28$ 17:21$
 */
@Component     // com 炮 nen te
@Aspect      // 切面
public class AnnotationAdvice {

    @Pointcut(value = "execution(public void com.qf.service.impl.PersonServiceImpl.save())")
    public void pointcut(){}

    @AfterReturning(value = "pointcut()",returning = "result")
    public void afterReturning(JoinPoint jp,Object result){
        System.out.println("我是注解的后置增强。。。。。。。。。。");
    }

    @Around(value = "pointcut()")
    public void around(ProceedingJoinPoint pjp){
        System.out.println(".....");
    }
}
